package Demo8;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-21
 * Time: 14:46
 */

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n=input.nextInt();
        int type;
        ComputeWeight [] goods=new ComputeWeight[n]; //n件货物
        for(int i=0;i<goods.length ;i++){
            type=input.nextInt();                    //读入家电类型
            if (type==1)
                goods[i]=new Television();
            else if (type==2)
                goods[i]=new AirConditioner();
            else if (type==3)
                goods[i]=new WashMachine();
        }
        Truck truck =new Truck(goods);
        System.out.printf("货车装载的货物总量:%8.2f kg",truck.getTotalWeight());
    }
}
interface ComputeWeight{
    double computeWeight();
}
class Television implements ComputeWeight{

    @Override
    public double computeWeight() {
        return 16.6;
    }
}
class AirConditioner implements ComputeWeight{

    @Override
    public double computeWeight() {
        return 40.0;
    }
}
class WashMachine implements ComputeWeight{

    @Override
    public double computeWeight() {
        return 60.0;
    }
}
class Truck{
    private ComputeWeight goods[];

    public Truck(ComputeWeight[] goods) {
        this.goods = goods;
    }

    public double getTotalWeight(){
        double sum = 0;
        for (int i = 0; i < goods.length; i++) {
            sum += goods[i].computeWeight();
        }
        return sum;
    }
}
/* 请在这里填写答案 */